package org.example;

import org.example.demo.Number;
import org.example.demo.Person;
import org.example.framework.MiniApplicationContext;
import org.example.framework.MiniApplicationException;


public class Application {
    public static void main(String[] args) {

        try{
        MiniApplicationContext app=new MiniApplicationContext("miniApplicationContext.xml");
        Object p=app.getBean("person");
        Object n=app.getBean("number");
        System.out.println(app.getBeans());
        Person p1=(Person)p;
        System.out.println(p1.getName()+" "+p1.getId_number());
        Number n1=(Number)n;
        System.out.println(n1.getNum());
        }
        catch(MiniApplicationException e){
            System.out.println(e.getErrorType()+":"+e.getMessage());
        }

    }
}